﻿/* 
 * author: www.cnblogs.com/luminji
 * date  : 2011/12/09
 */
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Luminji.Core.Data;
using Luminji.ExamWeb.Core.Domain;
using System.Data.SqlClient;

namespace Luminji.ExamWeb.Infrastructure.DataAccess.Impl.SqlServer
{
    public class UserRepository : IUserRepository
    {
        public void UpdateUser(Core.Domain.Model.User user)
        {
            throw new NotImplementedException();
        }

        public void InsertUser(Core.Domain.Model.User user)
        {
            SqlParameter[] parameters = new SqlParameter[]
                {
                    new SqlParameter("@UserID", user.UserId),
                    new SqlParameter("@UserName", user.UserName),
                    new SqlParameter("@UserPassword", user.UserPassword),
                    new SqlParameter("@Email", user.Email) 
                };
            SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionString, CommandType.Text, "Insert into User (UserID, UserName, UserPassword, Email) values (UserID, UserName, UserPassword, Email)", parameters);
        }

        public IList<Core.Domain.Model.User> GetUsersByUnitCode(string unitCode)
        {
            throw new NotImplementedException();
        }

        public Core.Domain.Model.User GetUserByUserId(string userId)
        {
            throw new NotImplementedException();
        }
    }
}
